package com.rgs.base.core.util.excel.bo;

import lombok.Data;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * @author Ren Gaoshuai
 * @date 2022-03-08 15:45
 **/
@Data
public class ExcelConfigBO {
    /**
     * 导出标题
     */
    private String exportTitle;

    /**
     * 简单的动态表头 k=属性名称  v=动态字段
     */
    private Map<String, String> titleMap;
    /**
     * 复杂动态表头 包含动态多表头和map嵌套
     */
    private Map<String, ExcelDynamicHeadBO> dynamicHeadMap;
    /**
     * 忽略字段列表
     */
    private Set<String> ignoreSet;


    public static final Map<String, String> DEF_TITLE_MAP
            = new HashMap<>(0);
    public static final Map<String, ExcelDynamicHeadBO> DEF_HEAD_MAP
            = new HashMap<>(0);
    public static final Set<String> DEF_IGNORE_SET
            = new HashSet<>(0);

    public ExcelConfigBO() {
        this("");
    }

    public ExcelConfigBO(String exportTitle, Map<String, String> titleMap,
                         Map<String, ExcelDynamicHeadBO> dynamicHeadMap,
                         Set<String> ignoreSet) {
        this.exportTitle = exportTitle;
        this.titleMap = titleMap;
        this.dynamicHeadMap = dynamicHeadMap;
        this.ignoreSet = ignoreSet;
    }


    public ExcelConfigBO(String exportTitle) {
        this(exportTitle, DEF_TITLE_MAP, DEF_HEAD_MAP, DEF_IGNORE_SET);
    }
}
